<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>游戏记录</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }
        .ios-shadow {
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        }
        .record-item {
            transition: all 0.3s ease;
        }
        .record-item:hover {
            transform: translateY(-2px);
        }
    </style>
</head>
<body class="min-h-screen">
    <!-- 顶部状态栏 -->
    <div class="bg-white/10 backdrop-blur-md text-white px-4 py-2 flex justify-between items-center">
        <div class="flex items-center space-x-2" onclick="location.href='index.html'">
            <i class="fas fa-arrow-left"></i>
            <span class="text-sm">返回</span>
        </div>
        <div class="text-sm font-medium">游戏记录</div>
        <div class="flex items-center space-x-1">
            <i class="fas fa-filter text-sm" onclick="showFilterModal()"></i>
        </div>
    </div>

    <!-- 统计概览 -->
    <div class="px-4 py-4">
        <div class="bg-white/95 backdrop-blur-md rounded-xl p-4 ios-shadow mb-4">
            <h3 class="text-lg font-semibold text-gray-800 mb-3 text-center">总体战绩</h3>
            <div class="grid grid-cols-4 gap-4 text-center">
                <div>
                    <div class="text-2xl font-bold text-blue-600">28</div>
                    <div class="text-xs text-gray-600">总局数</div>
                </div>
                <div>
                    <div class="text-2xl font-bold text-green-600">19</div>
                    <div class="text-xs text-gray-600">胜利</div>
                </div>
                <div>
                    <div class="text-2xl font-bold text-red-600">9</div>
                    <div class="text-xs text-gray-600">失败</div>
                </div>
                <div>
                    <div class="text-2xl font-bold text-purple-600">68%</div>
                    <div class="text-xs text-gray-600">胜率</div>
                </div>
            </div>
        </div>
    </div>

    <!-- 记录列表 -->
    <div class="px-4 pb-20">
        <div class="bg-white/95 backdrop-blur-md rounded-xl ios-shadow">
            <div class="p-4 border-b border-gray-200">
                <h3 class="text-lg font-semibold text-gray-800">最近对局</h3>
            </div>
            
            <div class="divide-y divide-gray-200">
                <!-- 游戏记录项 -->
                <div class="record-item p-4 flex items-center justify-between">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-gradient-to-br from-green-500 to-green-600 rounded-full flex items-center justify-center">
                            <i class="fas fa-trophy text-white"></i>
                        </div>
                        <div>
                            <div class="font-medium text-gray-800">胜利</div>
                            <div class="text-sm text-gray-600">vs AI · 黑棋</div>
                            <div class="text-xs text-gray-500">2024-01-15 14:30</div>
                        </div>
                    </div>
                    <div class="text-right">
                        <div class="text-sm font-medium text-green-600">+10分</div>
                        <div class="text-xs text-gray-500">15分钟</div>
                    </div>
                </div>

                <div class="record-item p-4 flex items-center justify-between">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-gradient-to-br from-red-500 to-red-600 rounded-full flex items-center justify-center">
                            <i class="fas fa-times text-white"></i>
                        </div>
                        <div>
                            <div class="font-medium text-gray-800">失败</div>
                            <div class="text-sm text-gray-600">vs 玩家123 · 白棋</div>
                            <div class="text-xs text-gray-500">2024-01-15 13:45</div>
                        </div>
                    </div>
                    <div class="text-right">
                        <div class="text-sm font-medium text-red-600">-5分</div>
                        <div class="text-xs text-gray-500">22分钟</div>
                    </div>
                </div>

                <div class="record-item p-4 flex items-center justify-between">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-gradient-to-br from-green-500 to-green-600 rounded-full flex items-center justify-center">
                            <i class="fas fa-trophy text-white"></i>
                        </div>
                        <div>
                            <div class="font-medium text-gray-800">胜利</div>
                            <div class="text-sm text-gray-600">vs AI · 黑棋</div>
                            <div class="text-xs text-gray-500">2024-01-15 12:20</div>
                        </div>
                    </div>
                    <div class="text-right">
                        <div class="text-sm font-medium text-green-600">+8分</div>
                        <div class="text-xs text-gray-500">18分钟</div>
                    </div>
                </div>

                <div class="record-item p-4 flex items-center justify-between">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-gradient-to-br from-green-500 to-green-600 rounded-full flex items-center justify-center">
                            <i class="fas fa-trophy text-white"></i>
                        </div>
                        <div>
                            <div class="font-medium text-gray-800">胜利</div>
                            <div class="text-sm text-gray-600">vs 玩家456 · 白棋</div>
                            <div class="text-xs text-gray-500">2024-01-14 20:15</div>
                        </div>
                    </div>
                    <div class="text-right">
                        <div class="text-sm font-medium text-green-600">+12分</div>
                        <div class="text-xs text-gray-500">25分钟</div>
                    </div>
                </div>

                <div class="record-item p-4 flex items-center justify-between">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-gradient-to-br from-red-500 to-red-600 rounded-full flex items-center justify-center">
                            <i class="fas fa-times text-white"></i>
                        </div>
                        <div>
                            <div class="font-medium text-gray-800">失败</div>
                            <div class="text-sm text-gray-600">vs AI · 黑棋</div>
                            <div class="text-xs text-gray-500">2024-01-14 19:30</div>
                        </div>
                    </div>
                    <div class="text-right">
                        <div class="text-sm font-medium text-red-600">-3分</div>
                        <div class="text-xs text-gray-500">12分钟</div>
                    </div>
                </div>

                <div class="record-item p-4 flex items-center justify-between">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-gradient-to-br from-green-500 to-green-600 rounded-full flex items-center justify-center">
                            <i class="fas fa-trophy text-white"></i>
                        </div>
                        <div>
                            <div class="font-medium text-gray-800">胜利</div>
                            <div class="text-sm text-gray-600">vs 玩家789 · 黑棋</div>
                            <div class="text-xs text-gray-500">2024-01-14 18:45</div>
                        </div>
                    </div>
                    <div class="text-right">
                        <div class="text-sm font-medium text-green-600">+15分</div>
                        <div class="text-xs text-gray-500">30分钟</div>
                    </div>
                </div>
            </div>
            
            <!-- 加载更多 -->
            <div class="p-4 text-center">
                <button class="text-blue-600 font-medium" onclick="loadMoreRecords()">
                    <i class="fas fa-chevron-down mr-2"></i>加载更多
                </button>
            </div>
        </div>
    </div>

    <!-- 筛选弹窗 -->
    <div id="filterModal" class="fixed inset-0 bg-black/50 backdrop-blur-sm hidden flex items-center justify-center z-50">
        <div class="bg-white rounded-2xl p-6 mx-4 w-full max-w-sm ios-shadow">
            <h3 class="text-lg font-semibold text-gray-800 mb-4 text-center">筛选条件</h3>
            
            <div class="space-y-4">
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">对局结果</label>
                    <div class="grid grid-cols-3 gap-2">
                        <button class="filter-btn bg-gray-100 text-gray-700 py-2 px-3 rounded-lg text-sm" data-filter="all">全部</button>
                        <button class="filter-btn bg-gray-100 text-gray-700 py-2 px-3 rounded-lg text-sm" data-filter="win">胜利</button>
                        <button class="filter-btn bg-gray-100 text-gray-700 py-2 px-3 rounded-lg text-sm" data-filter="lose">失败</button>
                    </div>
                </div>
                
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">对手类型</label>
                    <div class="grid grid-cols-2 gap-2">
                        <button class="filter-btn bg-gray-100 text-gray-700 py-2 px-3 rounded-lg text-sm" data-filter="ai">AI</button>
                        <button class="filter-btn bg-gray-100 text-gray-700 py-2 px-3 rounded-lg text-sm" data-filter="player">玩家</button>
                    </div>
                </div>
            </div>
            
            <div class="flex space-x-3 mt-6">
                <button onclick="closeFilterModal()" class="flex-1 bg-gray-200 text-gray-800 py-3 rounded-xl font-medium">
                    取消
                </button>
                <button onclick="applyFilter()" class="flex-1 bg-gradient-to-r from-blue-500 to-blue-600 text-white py-3 rounded-xl font-medium">
                    应用
                </button>
            </div>
        </div>
    </div>

    <!-- 底部导航栏 -->
    <div class="fixed bottom-0 left-0 right-0 bg-white/95 backdrop-blur-md border-t border-gray-200/50">
        <div class="flex justify-around py-3">
            <div class="flex flex-col items-center text-gray-400" onclick="location.href='index.html'">
                <i class="fas fa-home text-xl mb-1"></i>
                <span class="text-xs">首页</span>
            </div>
            <div class="flex flex-col items-center text-gray-400" onclick="location.href='game.html'">
                <i class="fas fa-gamepad text-xl mb-1"></i>
                <span class="text-xs">游戏</span>
            </div>
            <div class="flex flex-col items-center text-gray-400" onclick="location.href='profile.html'">
                <i class="fas fa-user text-xl mb-1"></i>
                <span class="text-xs">我的</span>
            </div>
        </div>
    </div>

    <script>
        // 显示筛选弹窗
        function showFilterModal() {
            document.getElementById('filterModal').classList.remove('hidden');
        }

        // 关闭筛选弹窗
        function closeFilterModal() {
            document.getElementById('filterModal').classList.add('hidden');
        }

        // 应用筛选
        function applyFilter() {
            // 这里可以添加筛选逻辑
            closeFilterModal();
        }

        // 加载更多记录
        function loadMoreRecords() {
            // 这里可以添加加载更多记录的逻辑
            alert('加载更多记录功能');
        }

        // 筛选按钮点击效果
        document.querySelectorAll('.filter-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                // 移除同组其他按钮的选中状态
                const group = this.parentElement;
                group.querySelectorAll('.filter-btn').forEach(b => {
                    b.classList.remove('bg-blue-500', 'text-white');
                    b.classList.add('bg-gray-100', 'text-gray-700');
                });
                
                // 添加当前按钮的选中状态
                this.classList.remove('bg-gray-100', 'text-gray-700');
                this.classList.add('bg-blue-500', 'text-white');
            });
        });

        // 默认选中"全部"
        document.querySelector('[data-filter="all"]').click();
    </script>
</body>
</html>